package com.gesis.delegate;

import java.util.List;

import com.gesis.entity.GesSubClassification;
import com.gesis.entity.GesTopic;
import com.gesis.logic.ISuchen;
import com.gesis.logic.imp.Suchen;

public class DASuchen {

	private static DASuchen INSTANCE = null;
	private ISuchen iSuchen;

	private DASuchen() {
		iSuchen = new Suchen();
	}

	private synchronized static void createInstance() {
		if (INSTANCE == null) {
			INSTANCE = new DASuchen();
		}
	}

	public static DASuchen getInstance() {
		if (INSTANCE == null) {
			createInstance();
		}
		return INSTANCE;
	}

	public List<GesTopic> searchForYear(String yearBegin, String yearEnd)
			throws Exception {
		return iSuchen.searchForYear(yearBegin, yearEnd);
	}

	public List<GesSubClassification> searchClassification(String clas)
			throws Exception {
		return iSuchen.searchClassification(clas);
	}

	public int countTopic(String yearBegin, String yearEnd, String idCla,
			String idTopic) throws Exception {
		return iSuchen.countTopic(yearBegin, yearEnd, idCla, idTopic);
	}
}
